home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / interp / perl5.005.tar.gz / perl5.005.tar / perl5.005 / configure.com < prev    next >
Text File  |  1998-07-13  |  66KB  |  2,038 lines

  1. $ sav_ver = 'F$VERIFY(0)'
  2. $! SET VERIFY
  3. $!
  4. $! Installation and usage: COPY this file into you perl source tree - at or 
  5. $! below where the main MANIFEST. file is located.
  6. $!
  7. $! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will 
  8. $! want to:
  9. $!
  10. $! $ COPY Configure.com [USER.PERL5_00n.VMS] 
  11. $!
  12. $! Now cd into the tree and execute Configure:
  13. $!
  14. $! $ SET DEFAULT [USER.PERL5_00n]
  15. $! $ @[.vms]Configure 
  16. $!
  17. $! or
  18. $!
  19. $! $ SET DEFAULT [USER.PERL5_00n]
  20. $! $ @[.vms]Configure "-des"
  21. $!
  22. $! That's it. If you get into a bind trying to build perl on VMS then 
  23. $! definitely read through the README.VMS file.
  24. $! Beyond that send email to VMSPerl@cor.newman.upenn.edu 
  25. $!
  26. $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  27. $!
  28. $! send suggestions to: 
  29. $!  Dan Sugalski <sugalskd@ous.edu>
  30. $! Thank you!!!!
  31. $!
  32. $! Adapted and converted from Larry Wall & Andy Dougherty's
  33. $! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
  34. $! (a Bourne sh[ell] script for configuring the installation of perl on VMS)
  35. $! in the perl5.002|3 epoch (spring/summer 1996)
  36. $! with much valuable help from Charles Bailey & 
  37. $! the whole VMSPerl crew.
  38. $! Extended and messed about with by Dan Sugalski
  39. $!
  40. $! SET NOVERIFY
  41. $ sav_ver = F$VERIFY(sav_ver)
  42. $!
  43. $! VMS-isms we will need:
  44. $ echo = "write sys$output "
  45. $ cat  = "type"
  46. $ gcc_symbol = "gcc"
  47. $ ans = ""
  48. $ macros = ""
  49. $ use_debugging_perl = "Y"
  50. $ C_Compiler_Replace = "CC="
  51. $ Thread_Live_Dangerously = "MT="
  52. $ use_two_pot_malloc = "N"
  53. $ use_pack_malloc = "N"
  54. $ use_debugmalloc = "N"
  55. $ preload_env = "N"
  56. $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
  57. $! max_allowed_dir_depth = 3  ! e.g. [A.B.PERL5_00n] not [A.B.C.PERL5_00n]
  58. $ max_allowed_dir_depth = 2  ! e.g. [FOO.PERL5_00n] not [FOO.BAR.PERL5_00n]
  59. $!
  60. $ vms_filcnt = F$GETJPI ("","FILCNT")
  61. $!
  62. $!: compute my invocation name
  63. $ me = F$ENVIRONMENT("PROCEDURE")
  64. $!
  65. $! Many null statements (begin with colon ':') in the Bourne shell version of
  66. $! this script serve as comments/placeholders. I have retained some of the ones
  67. $! that will help you compare this .COM file to the sh version - as well as
  68. $! leave placeholders for future improvements to this .COM file.
  69. $! sfn = VMS "skipped for now"
  70. $!
  71. $!: Proper PATH separator                              !sfn
  72. $!: Proper PATH setting                                !sfn
  73. $!: Sanity checks                                      !sfn "Say '@''$me''"
  74. $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
  75. $!: Configure runs within the UU subdirectory          !->after find MANIFEST
  76. $!   <big long list of default values (mostly null)>
  77. $!: We must find out about Eunice early                !(?)
  78. $!: list of known cpp symbols, sorted alphabetically   !sfn
  79. $!   al = al + "..."
  80. $!: default library list                               !sfn
  81. $!   <no hints files in use (yet?)>
  82. $!: Extra object files, if any, needed on this platform. !sfn
  83. $!: Possible local include directories to search.      !sfn
  84. $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
  85. $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
  86. $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
  87. $!: no include file wanted by default                  !sfn
  88. $!inclwanted=''                                        !sfn
  89. $!: Possible local library directories to search.      !sfn
  90. $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
  91. $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
  92. $!: general looking path for locating libraries        !sfn
  93. $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
  94. $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
  95. $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
  96. $!: Private path used by Configure to find libraries.  Its value !sfn
  97. $!: is prepended to libpth. This variable takes care of special !sfn
  98. $!: machines, like the mips.  Usually, it should be empty. !sfn
  99. $!plibpth=''                                           !sfn
  100. $!: full support for void wanted by default            !sfn
  101. $!defvoidused=15                                       !sfn
  102. $!: List of libraries we want.                         !sfn
  103. $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
  104. $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
  105. $!libswanted="$libswanted ucb bsd BSD PW x"            !sfn
  106. $!: We probably want to search /usr/shlib before most other libraries. !sfn
  107. $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
  108. $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
  109. $!glibpth="/usr/shlib $glibpth"                        !sfn
  110. $!: Do not use vfork unless overridden by a hint file. !sfn
  111. $!usevfork=false                                       !sfn
  112. $!: script used to extract .SH files with variable substitutions !sfn
  113. $!: produce awk script to parse command line options   !sfn
  114. $!sfn (assume no sed awk) see below
  115. $!: process the command line options         
  116. $!
  117. $!: set up default values
  118. $ fastread=""
  119. $ reuseval="false"
  120. $ config_sh=""
  121. $ alldone=""
  122. $ error=""
  123. $ silent=""
  124. $ extractsh=""
  125. $ override=""
  126. $ knowitall=""
  127. $ Using_Dec_C = ""
  128. $ Using_Vax_C = ""
  129. $ Using_Gnu_C = ""
  130. $ Dec_C_Version = ""
  131. $ use_threads = "F"
  132. $!
  133. $!: option parsing
  134. $ IF (P1 .NES. "")
  135. $ THEN            !one or more switches was thrown
  136. $   i = 1
  137. $   bang = 0
  138. $Param_loop:
  139. $   IF (P'i'.NES."") THEN bang = bang + 1
  140. $   i = i + 1
  141. $   IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
  142. $!
  143. $   i = 1
  144. $Opt_loop:
  145. $   IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
  146. $   IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
  147. $Remove_quotation_mark:
  148. $   P'i' = P'i' - """"
  149. $   IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
  150. $   gotopt      = "f" !"alse"
  151. $   gotshortopt = "f" !"alse"
  152. $   IF (F$EXTRACT(0,1,P'i') .EQS. "d")
  153. $   THEN
  154. $     fastread    = "yes"
  155. $     gotopt      = "t" !"rue"
  156. $     P'i'        = P'i' - "d"
  157. $     gotshortopt = "t" !"rue"
  158. $   ENDIF
  159. $   IF (F$EXTRACT(0,1,P'i') .EQS. "e")
  160. $   THEN
  161. $     alldone = "cont"
  162. $     gotopt = "t"
  163. $     P'i' = P'i' - "e"
  164. $     gotshortopt = "t"
  165. $   ENDIF
  166. $   IF (F$EXTRACT(0,1,P'i') .EQS. "f") !"-f")
  167. $   THEN
  168. $     P'i' = P'i' - "f"
  169. $     config_sh = P'i'
  170. $     IF (F$SEARCH(config_sh).NES."")
  171. $     THEN
  172. $       test = F$FILE_ATTRIBUTES(config_sh,"PRO")
  173. $       IF (F$LOCATE("R",test).NE.F$LENGTH(test)) 
  174. $       THEN
  175. $         CONTINUE !at this point check UIC && if test allows...
  176. $                  !to be continued ?
  177. $       ELSE
  178. $         echo "''me': cannot read config file ''config_sh'."
  179. $         error="true"
  180. $       ENDIF
  181. $     ELSE
  182. $       echo "''me': cannot read config file ''config_sh'."
  183. $       error="true"
  184. $     ENDIF
  185. $     gotopt = "t"
  186. $   ENDIF
  187. $   IF (F$EXTRACT(0,1,P'i') .EQS. "h")
  188. $   THEN
  189. $     error = "true"
  190. $     gotopt = "t"
  191. $     P'i' = P'i' - "h"
  192. $     gotshortopt = "t"
  193. $   ENDIF
  194. $   IF (F$EXTRACT(0,1,P'i') .EQS. "r")
  195. $   THEN
  196. $     reuseval = "true"
  197. $     gotopt = "t"
  198. $     P'i' = P'i' - "r"
  199. $     gotshortopt = "t"
  200. $   ENDIF
  201. $   IF (F$EXTRACT(0,1,P'i') .EQS. "s")
  202. $   THEN
  203. $     silent = "true"
  204. $     gotopt = "t"
  205. $     P'i' = P'i' - "s"
  206. $     gotshortopt = "t"
  207. $   ENDIF
  208. $   IF (F$EXTRACT(0,1,P'i') .EQS. "E") !"-E")
  209. $   THEN
  210. $     alldone = "exit"
  211. $     gotopt = "t"
  212. $   ENDIF
  213. $   IF (F$EXTRACT(0,1,P'i') .EQS. "K") !"-K")
  214. $   THEN
  215. $     knowitall = "true"
  216. $     gotopt = "t"
  217. $     P'i' = P'i' - "K"
  218. $     gotshortopt = "t"
  219. $   ENDIF
  220. $   IF (F$EXTRACT(0,1,P'i') .EQS. "O")
  221. $   THEN
  222. $     override = "true"
  223. $     gotopt = "t"
  224. $     P'i' = P'i' - "O"
  225. $     gotshortopt = "t"
  226. $   ENDIF
  227. $   IF (F$EXTRACT(0,1,P'i') .EQS. "S") !"-S")
  228. $   THEN
  229. $     extractsh = "true" !VMS?
  230. $     gotopt = "t"
  231. $     P'i' = P'i' - "S"
  232. $     gotshortopt = "t"
  233. $   ENDIF
  234. $   IF (F$EXTRACT(0,1,P'i') .EQS. "D") !"-D")
  235. $   THEN
  236. $     P'i' = P'i' - "D"
  237. $!Hmm.. this part needs work
  238. $!       P'i'
  239. $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
  240. $     THEN
  241. $       P'i' = "define"
  242. $     ELSE 
  243. $       IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
  244. $       THEN
  245. $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
  246. $         echo "''me': use '-Usymbol=val' not '-Dsymbol='."
  247. $         echo "''me': ignoring -D",P'i'
  248. $       ELSE
  249. $!Hmm.. this part needs work
  250. $!           'F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')' = -
  251. $! 'F$EXTRACT(F$LOCATE("=",P'i'),P'i'),F$LENGTH(P'i'),P'i')'
  252. $       ENDIF
  253. $     ENDIF
  254. $     ECHO "P''i' =>",P'i',"<="  !Diag
  255. $     gotopt = "t"
  256. $   ENDIF
  257. $   IF (F$EXTRACT(0,1,P'i') .EQS. "U") !"-U")
  258. $   THEN
  259. $     P'i' = P'i' - "U"
  260. $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
  261. $     THEN
  262. $       P'i' = ""
  263. $     ELSE 
  264. $       IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
  265. $       THEN
  266. $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
  267. $         echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
  268. $         echo "''me': ignoring -U",P'i'
  269. $       ELSE
  270. $         P'i' = "undef"
  271. $       ENDIF
  272. $     ENDIF
  273. $     ECHO "P''i' =>",P'i',"<="  !Diag
  274. $     gotopt = "t"
  275. $   ENDIF
  276. $   IF (F$EXTRACT(0,1,P'i') .EQS. "V")
  277. $   THEN
  278. $     me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
  279. $     echo "''me' generated by an unknown version of EDT."
  280. $     STOP
  281. $     EXIT !0
  282. $   ENDIF
  283. $   IF .NOT.gotopt 
  284. $   THEN
  285. $     echo "''me': unknown option ",P'i'
  286. $     error = "true"
  287. $   ENDIF
  288. $   IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
  289. $   i = i + 1 
  290. $   IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
  291. $!
  292. $ ENDIF  ! (P1 .NES. "")
  293. $!
  294. $ IF (error)
  295. $ THEN
  296. $   me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
  297. $   echo "Usage: @''me' [-dehrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
  298. $   echo "                [-Usymbol] [-Usymbol=]"
  299. $   TYPE SYS$INPUT
  300.  "-d" : use defaults for all answers.
  301.  "-e" : go on without questioning past the production of config.sh.    *
  302.  "-f" : specify an alternate default configuration file.
  303.  "-h" : print this help message and exit (with an error status).
  304.  "-r" : reuse C symbols value if possible (skips costly nm extraction).*
  305.  "-s" : silent mode, only echoes questions and essential information.
  306.  -"D" : define symbol to have some value:                              *
  307.          -"Dsymbol"         symbol gets the value 'define'
  308.          -"Dsymbol=value"   symbol gets the value 'value'
  309.   -E  : stop at the end of questions, after having produced config.sh. *
  310.   -K  : do not use unless you know what you are doing.
  311.   -O  : let -D and -U override definitions from loaded configuration file. *
  312.   -S  : perform variable substitutions on all .SH files (can mix with -f) *
  313.  -"U" : undefine symbol:                                               *
  314.          -"Usymbol"    symbol gets the value 'undef'
  315.          -"Usymbol="   symbol gets completely empty
  316.   -V  : print version number and exit (with a zero status).
  317. $   echo "%Config-I-VMS, lower case switches must be enclosed"
  318. $   echo "-Config-I-VMS, in double quotation marks, e.g.:"
  319. $   echo "-Config-I-VMS,   @Configure ""-des"""
  320. $   echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
  321. $   SET DEFAULT 'vms_default_directory_name' !be kind rewind
  322. $   STOP
  323. $   EXIT 3 ! $STATUS = "%X00000003" (informational)
  324. $ ENDIF
  325. $!
  326. $ GOTO Check_silence
  327. $!
  328. $Shut_up:
  329. $ STDOUT = F$TRNLNM("SYS$OUTPUT")
  330. $ DEFINE SYS$OUTPUT "_NLA0:"
  331. $ echo4 = "write STDOUT "
  332. $ cat4 = "TYPE/OUTPUT=''STDOUT'"
  333. $ open/write STDOUT 'STDOUT'
  334. $ RETURN
  335. $!
  336. $Check_silence:
  337. $ IF (silent) 
  338. $ THEN
  339. $   GOSUB Shut_up
  340. $ ELSE
  341. $   echo4 = "write SYS$OUTPUT "
  342. $   cat4 = "TYPE"
  343. $ ENDIF
  344. $!
  345. $!: run the defines and the undefines, if any, but leave the file out there...
  346. $! Unfortunately Configure.COM in DCL is not yet set up to do this - 
  347. $! maybe someday
  348. $!
  349. $!: set package name
  350. $ package = "perl5"
  351. $!
  352. $!: Eunice requires " " instead of "", can you believe it
  353. $ echo ""
  354. $!: Here we go...
  355. $ echo "Beginning of configuration questions for ''package'."
  356. $ echo ""
  357. $!
  358. $!: Some greps do not return status, grrr.
  359. $ contains = "SEARCH"
  360. $!
  361. $!: first determine how to suppress newline on echo command !cant DCL is record oriented
  362. $! echo "Checking ''echo' to see how to suppress newlines..."
  363. $! echo "giving up..."
  364. $! echo "The star should be here-->*"
  365. $!
  366. $!: Now test for existence of everything in MANIFEST
  367. $ echo ""
  368. $ echo4 "First let's make sure your kit is complete.  Checking..."
  369. $ manifestfound = "" 
  370. $ miss_list = "" 
  371. $! Here I assume we are in the [foo.PERL5xxx.VMS...] tree
  372. $! because the search routine simply does set def [-] if necessary.
  373. $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...] 
  374. $Research_manifest:
  375. $ manifestfound = F$SEARCH(file_2_find)
  376. $ IF (manifestfound .EQS. "")
  377. $ THEN
  378. $   IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
  379. $   THEN
  380. $     SET DEFAULT [-]
  381. $     GOTO Research_manifest
  382. $   ELSE
  383. $     echo ""
  384. $     echo "There is no MANIFEST file.  I hope your kit is complete !"
  385. $     miss_list = ""
  386. $     GOTO Beyond_manifest
  387. $   ENDIF
  388. $ ELSE
  389. $! MANIFEST. has been found and we have set def'ed there - 
  390. $! time to bail out before it's too late.
  391. $   IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
  392. $   THEN
  393. $     TYPE SYS$INPUT:
  394. %Config-E-VMS, ERROR:
  395.  Sorry! It apears as though your perl build sub-directory is already too
  396.  deep into the VMS file system. Please try moving stuff into a shallower 
  397.  directory (or altering the "max_allowed_dir_depth" parameter).
  398. $     echo4 "ABORTING..."
  399. $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
  400. $     STOP
  401. $     EXIT !2 !$STATUS = "%X00000002" (error)
  402. $   ENDIF
  403. $!
  404. $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
  405. $!
  406. $   IF (manifestfound .NES. "")
  407. $   THEN
  408. $     IF ( F$SEARCH("UU.DIR").EQS."" )
  409. $     THEN
  410. $       CREATE/DIRECTORY [.UU]
  411. $     ELSE
  412. $       IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
  413. $     ENDIF
  414. $!: Configure runs within the UU subdirectory
  415. $     SET DEFAULT [.UU]
  416. $!
  417. $! a little redundancy never hurt anybody?
  418. $     file_2_find = "[-]" + file_2_find
  419. $     manifestfound = F$SEARCH(file_2_find)
  420. $!
  421. $     OPEN/WRITE MISSING MISSING.
  422. $!change to "FALSE" if you wish to skip the manifest search 
  423. $!(which after all is rather slow in DCL :-)
  424. $     IF ("TRUE")    
  425. $     THEN
  426. $       OPEN/READ CONFIG 'manifestfound'
  427. $Read_loop_manifest:
  428. $       READ/END_OF_FILE = Done_manifest CONFIG line
  429. $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
  430. $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
  431. $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
  432. $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
  433. $       line = F$EDIT(line,"TRIM, COMPRESS")
  434. $       file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line) 
  435. $       IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find) 
  436. $       THEN 
  437. $Re_strip_line_manifest:
  438. $         loca = F$LOCATE("/",file_2_find)
  439. $         ante = F$EXTRACT(0,loca,file_2_find)
  440. $         post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
  441. $         test_this = ante + "." + (post - "/")
  442. $         IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
  443. $         THEN 
  444. $           file_2_find = ante + "." + (post - "/")
  445. $           GOTO Re_strip_line_manifest
  446. $         ELSE
  447. $           file_2_find = ante + "]" + (post - "/")
  448. $         ENDIF
  449. $           file_2_find = "[-."+file_2_find
  450. $       ELSE
  451. $         file_2_find = "[-]" + file_2_find
  452. $       ENDIF
  453. $!
  454. $       dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
  455. $       file_2_find = file_2_find - dirname
  456. $       dots = 0
  457. $Dot_loop:
  458. $       dot_ele = F$ELEMENT(dots,".",file_2_find)
  459. $       IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
  460. $       IF dots .eq. 0
  461. $       THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
  462. $       ELSE basename = basename + dot_ele + "_"
  463. $       ENDIF
  464. $       dots = dots + 1
  465. $       GOTO dot_loop
  466. $Eo_dot_loop:
  467. $       IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
  468.              (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
  469.           basename = f$extract(0,f$length(basename)-1,basename)
  470. $       file_2_find = dirname + basename
  471. $!
  472. $       found = F$SEARCH(file_2_find)
  473. $       IF (found .EQS. "")
  474. $       THEN
  475. $         WRITE MISSING file_2_find
  476. $         IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
  477. $         THEN
  478. $           miss_list = miss_list + "," + file_2_find
  479. $         ENDIF
  480. $       ENDIF
  481. $       GOTO Read_loop_manifest
  482. $Done_manifest:
  483. $       CLOSE CONFIG
  484. $     ENDIF  !"TRUE"
  485. $     CLOSE MISSING
  486. $   ENDIF ! (manifestfound .NES. "")
  487. $Beyond_manifest:
  488. $   IF (miss_list .NES. "")
  489. $   THEN
  490. $     echo "Some of the files not found include:"
  491. $     cat4 MISSING.
  492. $   ENDIF
  493. $   IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
  494. $   THEN
  495. $     TYPE SYS$INPUT:
  496.  
  497. THIS PACKAGE SEEMS TO BE INCOMPLETE.
  498.  
  499. You have the option of continuing the configuration process, despite the
  500. distinct possibility that your kit is damaged, by typing 'y'es.  If you
  501. do, don't blame me if something goes wrong.  I advise you to type 'n'o
  502. and contact the author (sugalskd@ous.edu).
  503.  
  504. $     READ SYS$COMMAND/PROMPT="Continue? [n] " ans
  505. $     IF ans
  506. $     THEN
  507. $       echo4 "Continuing..."
  508. $     ELSE
  509. $       echo4 "ABORTING..."
  510. $       GOTO Clean_up
  511. $     ENDIF
  512. $   ELSE
  513. $     echo4 "Looks good..."
  514. $     DELETE/NOLOG MISSING.;
  515. $   ENDIF ! (miss_list .NES. "")
  516. $ ENDIF   ! (manifestfound .EQS. "") ELSE 
  517. $!
  518. $! after finding MANIFEST (see above)
  519. $!: Configure runs within the UU subdirectory 
  520. $!
  521. $!: compute the number of columns on the terminal for proper question formatting
  522. $! (sfn, will assume 80-ish)
  523. $!
  524. $!: set up the echo used in my read              !sfn
  525. $!: now set up to do reads with possible shell escape and default assignment !sfn
  526. $ GOTO Beyond_myread
  527. $!
  528. $myread:
  529. $ ans = ""
  530. $ If (fastread)
  531. $ Then
  532. $   echo4 "''rp'"
  533. $ Else
  534. $   If (silent)
  535. $   Then
  536. $     READ SYS$COMMAND/PROMPT="''rp'" ans
  537. $   Else
  538. $     echo ""
  539. $     READ SYS$COMMAND/PROMPT="''rp'" ans
  540. $   Endif
  541. $ Endif
  542. $ RETURN
  543. $!
  544. $Beyond_myread:
  545. $!
  546. $!: create .config dir to save info across Configure sessions
  547. $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
  548. $ THEN
  549. $   CREATE/DIRECTORY [-.CONFIG]
  550. $   OPEN/WRITE CONFIG [-.CONFIG]README.
  551. $   WRITE CONFIG -
  552.       "This directory created by Configure to save information that should"
  553. $   WRITE CONFIG -
  554.       "persist across sessions."
  555. $   WRITE CONFIG ""
  556. $   WRITE CONFIG -
  557.       "You may safely delete it if you wish."
  558. $   CLOSE CONFIG
  559. $ ENDIF
  560. $!
  561. $!: general instructions
  562. $ needman = "true"
  563. $ firsttime = "true"
  564. $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
  565. $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
  566. $ THEN
  567. $   messages = F$ENVIRONMENT("MESSAGE")
  568. $   SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
  569. $   contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
  570. $   IF .NOT.($status.EQ.%X08D78053)
  571. $   THEN
  572. $     firsttime=""
  573. $     dflt = "n"
  574. $     rp = "Would you like to see the instructions? [''dflt'] "
  575. $     GOSUB myread
  576. $     if .NOT.ans THEN needman=""
  577. $   ENDIF
  578. $   SET MESSAGE 'messages'                 !hope you made it here :-)
  579. $ ENDIF
  580. $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
  581. $!
  582. $ IF (needman)
  583. $ THEN
  584. $   TYPE SYS$INPUT:
  585.  
  586. This installation shell script will examine your system and ask you questions
  587. to determine how the perl5 package should be installed. If you get
  588. stuck on a question, you may use a ^C or ^Y shell escape to STOP this
  589. process, edit something, then restart this process as you just did.
  590. Many of the questions will have default answers in square
  591. brackets; typing carriage return will give you the default.
  592.  
  593. $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
  594. $   TYPE SYS$INPUT:
  595.  
  596. In a hurry? You may run '@Configure -d'.  This will bypass nearly all
  597. the questions and use the computed defaults (or the previous answers provided 
  598. there was already a config.sh file). Type '@Configure -h' for a list of 
  599. options.
  600.  
  601. $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
  602. $   TYPE SYS$INPUT:
  603.  
  604. Much effort has been expended to ensure that this shell script will
  605. run on any VMS system.  If despite that it blows up on yours, your
  606. best bet is to edit Configure.com and @ it again.  Whatever problems
  607. you have with Configure.com, let me (sugalskd@ous.edu) know how I blew
  608. it.
  609.  
  610. $!This installation script affects things in two ways:
  611. $!
  612. $!1) it may do direct variable substitutions on some of the files included
  613. $!   in this kit.
  614. $!2) it builds a config.h file for inclusion in C programs.  You may edit
  615. $!   any of these files as the need arises after running this script.
  616. $!
  617. $!If you make a mistake on a question, there is no easy way to back up to it
  618. $!currently.
  619. $!
  620. $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
  621. $   IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
  622. $   THEN
  623. $     OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
  624. $     WRITE CONFIG user 
  625. $     CLOSE CONFIG
  626. $   ENDIF
  627. $ ENDIF  !(needman .EQS. "true")
  628. $!
  629. $!: see if sh knows # comments             !sfn
  630. $ sharpbang = "$ "
  631. $!: figure out how to guarantee sh startup !sfn
  632. $!: find out where common programs are     !sfn
  633. $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
  634. $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
  635. $! echo "I don't know where '$file' is, and my life depends on it."
  636. $! echo "Go find a public domain implementation or fix your PATH setting!"
  637. $! echo ""
  638. $! echo "Don't worry if any of the following aren't found..."
  639. $!: determine whether symbolic links are supported !sfn
  640. $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
  641. $!: set up the translation script tr, must be called with ./tr of course !sfn
  642. $!
  643. $!: Try to determine whether config.sh was made on this system
  644. $!: Get old answers from old config file if Configure was run on the
  645. $!: same system, otherwise use the hints.
  646. $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
  647. $ i = 0
  648. $ max = 3
  649. $Config_sh_look:
  650. $ config_sh = F$ELEMENT(i,"/",config_sh_es)
  651. $ i = i + 1
  652. $ IF (config_sh.NES."/").AND.(config_sh.NES."")
  653. $ THEN
  654. $   configshfound = F$SEARCH(config_sh)
  655. $   IF (configshfound.NES."") THEN GOTO Config_sh_found
  656. $ ENDIF
  657. $ IF (i.LT.max) THEN GOTO Config_sh_look
  658. $ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
  659. $Config_sh_found:
  660. $ echo ""
  661. $ echo "Fetching default answers from ''config_sh'..."
  662. $!we actually do not have "hints/" for VMS
  663. $!     TYPE SYS$INPUT:
  664. $!
  665. $!First time through, eh?  I have some defaults handy for the following systems:
  666. $!
  667. $!     echo "     ","VMS_VAX"
  668. $!     echo "     ","VMS_AXP"
  669. $!        : Now look for a hint file osname_osvers, unless one has been
  670. $!        : specified already.
  671. $!     TYPE SYS$INPUT:
  672. $!
  673. $!You may give one or more space-separated answers, or "none" if appropriate.
  674. $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
  675. $!
  676. $!     READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
  677. $!
  678. $Beyond_config_sh:
  679. $!
  680. $!: Restore computed paths          !sfn
  681. $!
  682. $! genconfig.pl has "osname='VMS'"
  683. $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE") 
  684. $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
  685. $!
  686. $ IF (osname .NES. "VMS")
  687. $ THEN
  688. $   echo4 "Hmm.. I wonder what ''osname' is (?)"
  689. $   TYPE SYS$INPUT:
  690.  
  691. %Config-E-VMS, ERROR:
  692.  
  693.            Err, you do not appear to be running VMS!
  694.  This package is intended to Configure the building of Perl for VMS.
  695.  
  696. $   READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
  697. $   IF ans
  698. $   THEN
  699. $     echo4 "Continuing..."
  700. $   ELSE
  701. $     echo4 "ABORTING..."
  702. $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
  703. $     STOP
  704. $     EXIT 2 !$STATUS = "%X00000002" (error)
  705. $   ENDIF
  706. $ ELSE           !we are on VMS huzzah!
  707. $   IF .NOT.silent 
  708. $   THEN TYPE SYS$INPUT:
  709.  
  710. Configure uses the operating system name and version to set some defaults.
  711. The default value is probably right if the name rings a bell. Otherwise,
  712. since spelling matters for me, either accept the default or answer "none"
  713. to leave it blank.
  714. $   ENDIF
  715. $   rp = "Operating system name? [''osname'] "
  716. $   GOSUB myread
  717. $   IF ans.nes.""
  718. $   THEN
  719. $     IF (ans.NES.osname) !.AND.knowitall
  720. $     THEN
  721. $       echo4 "I'll go with ''osname' anyway..."
  722. $     ENDIF
  723. $   ENDIF
  724. $ ENDIF !(osname .NES./.EQS. "VMS")
  725. $!
  726. $!: who configured the system
  727. $! see 'user' above.
  728. $ cf_by = F$EDIT(user,"LOWERCASE")
  729. $! cf_time = F$CVTIME()                 !superceded by procedure below
  730. $ osvers = F$GETSYI("VERSION")
  731. $!
  732. $! Peter Prymmer has seen:
  733. $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-46800"  (sic)
  734. $!  "SYS$TIME_ZONE" = "EDT"
  735. $!
  736. $! Charles Lane recommended:
  737. $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
  738. $!  "NEWS_TIMEZONE" = "-0500"
  739. $!  "ST_TIMEZONE" = "EDT"
  740. $!  "JAN_TIME_ZONE" = "EST  "
  741. $!  "MULTINET_TIMEZONE" = "EST"
  742. $!  "DAYLIGHT_SAVINGS"  = "1"
  743. $!
  744. $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
  745. $!   "PMDF_Timezone"
  746. $!   "Multinet_Timezone"
  747. $!   "TCPware_Timezone"
  748. $!   "WIN$Time_Zone"
  749. $!
  750. $! This snippet o' DCL returns a string in default Unix `date` format,
  751. $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
  752. $! Peter Prymmer pvhp@lns62.lns.cornell.edu
  753. $!
  754. $ MIN_TZO = -840  !units are minutes here
  755. $ MAX_TZO =  840
  756. $!
  757. $ wkday  = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
  758. $ monn   = F$CVTIME(,,"MONTH")
  759. $ mday   = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
  760. $ hour   = F$CVTIME(,,"HOUR")
  761. $ min    = F$CVTIME(,,"MINUTE")
  762. $ sec    = F$CVTIME(,,"SECOND")
  763. $ year   = F$CVTIME(,,"YEAR")
  764. $!
  765. $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
  766. $ i = 0
  767. $Mon_loop:
  768. $ i = i + 1
  769. $ mon = F$ELEMENT(i,"/",months)
  770. $ IF i.LT.monn THEN GOTO Mon_loop
  771. $!
  772. $ tzneedset = "t"
  773. $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
  774. $ IF systz.NES.""
  775. $ THEN
  776. $   tzhour = F$INTEGER(systz)/3600
  777. $   tzmins = F$INTEGER(systz)/60
  778. $   tzminrem = tzmins - tzhour*60
  779. $   IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem  !keeps !2ZL happy
  780. $   IF tzhour.ge.0 
  781. $   THEN signothetime = "+" 
  782. $     IF tzhour.EQ.0.AND.tzminrem.EQ.0 
  783. $     THEN direction = "on GMT/"
  784. $     ELSE direction = "east of "
  785. $     ENDIF
  786. $   ELSE signothetime = "-"
  787. $     tzhour = -1*tzhour                          !keeps !UL happy
  788. $     direction = "west of "
  789. $   ENDIF
  790. $   echo ""
  791. $   echo "%Config-I-VMS,"
  792. $   echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
  793. $   IF tzminrem.ne.0
  794. $   THEN
  795. $     tzspan = "''tzhour' hours & ''tzminrem' minutes"
  796. $   ELSE
  797. $     tzspan = "''tzhour' hours"
  798. $   ENDIF
  799. $   dflt = "y"
  800. $   echo "Your system is ''tzspan' ''direction'UTC in England."
  801. $   rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
  802. $   GOSUB myread
  803. $   IF ans.OR.(ans.EQS."") 
  804. $   THEN 
  805. $     tzneedset = "f"
  806. $     tzd = systz
  807. $     GOTO Beyond_TimeZone
  808. $   ENDIF
  809. $ ELSE
  810. $   echo ""
  811. $   echo4 "%Config-I-VMS,"
  812. $   echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
  813. $ ENDIF
  814. $!
  815. $TZSet:
  816. $ echo ""
  817. $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
  818. $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
  819. $ echo "Eastern Daylight Time (summer) is -4:00 offset."
  820. $ dflt = "0:00"
  821. $ rp = "Enter the Time Zone offset: [''dflt'] "
  822. $ GOSUB myread
  823. $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
  824. $ IF ans.EQS."" THEN ans = dflt
  825. $ tzhour   = F$ELEMENT(0,":","''ans'") !first
  826. $ IF tzhour.EQS."" THEN tzhour = 0
  827. $ tzhour   = F$INTEGER(tzhour)
  828. $ tzminrem = F$ELEMENT(1,":","''ans'") !second
  829. $ IF tzminrem.NES."" 
  830. $ THEN 
  831. $   tzminrem = F$INTEGER(tzminrem)
  832. $   IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
  833. $ ELSE 
  834. $   tzminrem = 0
  835. $ ENDIF
  836. $ tzmins = tzhour*60 + tzminrem
  837. $ tzd = F$STRING(tzmins*60)
  838. $ IF tzhour .GE. 0 
  839. $ THEN
  840. $   signothetime = "+" 
  841. $ ELSE
  842. $   tzhour = -1*tzhour       !keeps !UL happy
  843. $   signothetime = "-"
  844. $ ENDIF
  845. $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
  846. $ THEN
  847. $   echo ""
  848. $   echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
  849. $   goto TZSet
  850. $ ENDIF
  851. $!
  852. $Beyond_TimeZone:
  853. $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
  854. $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
  855. $!
  856. $!: determine the architecture name  
  857. $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
  858. $!
  859. $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
  860. $ THEN 
  861. $   archname = "VMS_VAX"
  862. $ ELSE
  863. $   archname = "VMS_AXP"
  864. $ ENDIF
  865. $ rp = "What is your architecture name? [''archname'] "
  866. $ GOSUB myread
  867. $ IF ans.NES.""
  868. $ THEN
  869. $   ans = F$EDIT(ans,"COLLAPSE, UPCASE")
  870. $   IF (ans.NES.archname) !.AND.knowitall
  871. $   THEN
  872. $     echo4 "I'll go with ''archname' anyway..."
  873. $   ENDIF
  874. $ ENDIF
  875. $ IF (archname.EQS."VMS_AXP")
  876. $ THEN
  877. $   dflt = "N"
  878. $   rp = "Are you sharing your PERL_ROOT with a VAX? [''dflt'] "
  879. $   GOSUB myread
  880. $   if ans.NES.""
  881. $   THEN
  882. $     ans = F$EDIT(ans,"COLLAPSE, UPCASE")
  883. $   ENDIF
  884. $   IF (ans.NES."Y")
  885. $   THEN
  886. $     sharedperl = "N"
  887. $   ELSE
  888. $     sharedperl = "Y"
  889. $     macros = macros + """AXE=1"","
  890. $   ENDIF
  891. $ ELSE
  892. $   sharedperl = "N"
  893. $ ENDIF
  894. $!
  895. $!: is AFS running?                       !sfn
  896. $!: decide how portable to be.  Allow command line overrides. !sfn
  897. $!: set up shell script to do ~ expansion !sfn
  898. $!: expand filename                       !sfn
  899. $!: now set up to get a file name         !sfn
  900. $!
  901. $ vms_skip_install = "true"
  902. $ dflt = "y"
  903. $! echo ""
  904. $ rp = "%Config-I-VMS, Do you wish to skip the """"where install"""" questions? [''dflt'] "
  905. $ GOSUB myread
  906. $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
  907. $ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
  908. $ prefix = f$parse(prefix,,,,"NO_CONCEAL") - "][" - ".;"
  909. $ prefix = prefix - "]" + ".]"
  910. $ IF (.NOT.vms_skip_install)
  911. $ THEN
  912. $!: determine root of directory hierarchy where package will be installed.
  913. $   dflt = "default"
  914. $   IF .NOT.silent 
  915. $   THEN 
  916. $     echo ""
  917. $     echo "By default, ''package' will be installed in ''dflt'/bin, manual"
  918. $     echo "pages under ''dflt'/man, etc..., i.e. with ''dflt' as prefix for"
  919. $     echo "all installation directories. Typically set to /usr/local, but you"
  920. $     echo "may choose /usr if you wish to install ''package' among your system
  921. $   ENDIF
  922. $   IF .NOT.silent 
  923. $   THEN TYPE SYS$INPUT:
  924. binaries. If you wish to have binaries under /bin but manual pages
  925. under /usr/local/man, that's ok: you will be prompted separately
  926. for each of the installation directories, the prefix being only used
  927. to set the defaults.
  928. $   ENDIF
  929. $   dflt = prefix
  930. $   rp = "Installation prefix to use? [ ''dflt' ] "
  931. $   GOSUB myread
  932. $   IF ans.NES.""
  933. $   THEN 
  934. $     prefix = ans
  935. $     IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
  936. $   ELSE 
  937. $     prefix = dflt
  938. $   ENDIF
  939. $!
  940. $!: set the prefixit variable, to compute a suitable default value
  941. $!
  942. $!: determine where private library files go
  943. $!: Usual default is /usr/local/lib/perl5.  Also allow things like 
  944. $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
  945. $   IF .NOT.silent 
  946. $   THEN TYPE SYS$INPUT:
  947.  
  948. There are some auxiliary files for perl5 that need to be put into a
  949. private library directory that is accessible by everyone.
  950. $   ENDIF
  951. $   dflt = prefix - ".]" + ".LIB]"
  952. $   rp = "Pathname where the private library files will reside? " 
  953. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  954. $   GOSUB myread
  955. $   IF ans.NES.""
  956. $   THEN privlib = ans
  957. $   ELSE privlib = dflt
  958. $   ENDIF
  959. $!
  960. $ ENDIF !%Config-I-VMS, skip "where install" questions
  961. $!
  962. $!: set the base revision
  963. $ baserev="5.0"
  964. $!: get the patchlevel
  965. $ echo ""
  966. $ echo4 "Getting the current patchlevel..." !>&4
  967. $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
  968. $ IF (patchlevel_h.NES."")
  969. $ THEN
  970. $   got_patch = "false"
  971. $   got_sub   = "false"
  972. $   OPEN/READONLY CONFIG 'patchlevel_h' 
  973. $Patchlevel_h_loop:
  974. $   READ/END_Of_File=Close_patch CONFIG line
  975. $   IF ((F$LOCATE("#define PATCHLEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
  976. $   THEN
  977. $     line = F$EDIT(line,"COMPRESS, TRIM")
  978. $     patchlevel = F$EXTRACT(18,F$LENGTH(line)-18,line)
  979. $     got_patch = "true"
  980. $   ENDIF
  981. $   IF ((F$LOCATE("SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
  982. $   THEN
  983. $     line = F$EDIT(line,"COMPRESS, TRIM")
  984. $     subversion = F$EXTRACT(18,F$LENGTH(line)-18,line)
  985. $     got_sub = "true"
  986. $   ENDIF
  987. $   IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
  988. $Close_patch:
  989. $   CLOSE CONFIG
  990. $   ELSE
  991. $     patchlevel="0"
  992. $     subversion="0"
  993. $ ENDIF
  994. $ echo "(You have ''package' ''baserev' PL''patchlevel' sub''subversion'.)"
  995. $! This whole thing needs replacing w/ F$FAO() calls:
  996. $ patchlevel = F$INTEGER(patchlevel)
  997. $ IF patchlevel.LT.10
  998. $ THEN patchlevel = "00" + F$STRING(patchlevel)
  999. $ ELSE patchlevel = "0" + F$STRING(patchlevel)
  1000. $ ENDIF
  1001. $ subversion = F$INTEGER(subversion)
  1002. $ IF subversion.GT.0
  1003. $ THEN
  1004. $   IF subversion.LT.10
  1005. $   THEN subversion = "0" + F$STRING(subversion)
  1006. $   ELSE subversion = F$STRING(subversion)
  1007. $   ENDIF
  1008. $ ELSE subversion = ""
  1009. $ ENDIF
  1010. $!
  1011. $ version = F$EXTRACT(0,1,baserev) + "_" + patchlevel + subversion
  1012. $!
  1013. $ IF (.NOT.vms_skip_install)
  1014. $ THEN
  1015. $!: set the prefixup variable, to restore leading tilda escape !sfn
  1016. $!: set the prefixup variable, to restore leading tilde escape !sfn
  1017. $!
  1018. $!: determine where public architecture dependent libraries go
  1019. $   IF (.NOT.silent) 
  1020. $   THEN 
  1021. $     echo ""
  1022. $     echo "''package' contains architecture-dependent library files.  If you are"
  1023. $   ENDIF
  1024. $   IF (.NOT.silent) 
  1025. $   THEN TYPE SYS$INPUT:
  1026. sharing libraries in a heterogeneous environment, you might store
  1027. these files in a separate location.  Otherwise, you can just include
  1028. them with the rest of the public library files.
  1029. $   ENDIF
  1030. $   dflt = privlib - "]" + "." + archname + "." + version + "]"
  1031. $   rp = "Where do you want to put the public architecture-dependent libraries? "
  1032. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1033. $   GOSUB myread
  1034. $   IF ans.NES.""
  1035. $   THEN archlib = ans
  1036. $   ELSE archlib = dflt
  1037. $   ENDIF
  1038. $!
  1039. $!: set up the script used to warn in case of inconsistency !sfn
  1040. $!: function used to set $1 to $val                         !sfn
  1041. $!
  1042. $ ENDIF !%Config-I-VMS, skip "where install" questions
  1043. $! This quotation from Configure has to be included on VMS:
  1044. $ TYPE SYS$INPUT:
  1045.  
  1046. There is, however, a strange, musty smell in the air that reminds me of
  1047. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  1048. $ CONTINUE
  1049. $ IF (.NOT.vms_skip_install)
  1050. $ THEN
  1051. $!: it so happens the Eunice I know will not run shell scripts in Unix format
  1052. $!
  1053. $!: see if setuid scripts can be secure           !sfn
  1054. $!: now see if they want to do setuid emulation   !sfn
  1055. $!
  1056. $!: determine where site specific libraries go.
  1057. $   IF .NOT.silent 
  1058. $   THEN TYPE SYS$INPUT:
  1059.  
  1060. The installation process will also create a directory for
  1061. site-specific extensions and modules.  Some users find it convenient
  1062. to place all local files in this directory rather than in the main
  1063. distribution directory.
  1064. $   ENDIF
  1065. $   dflt = privlib - "]" + ".SITE_PERL]"
  1066. $   rp = "Pathname for the site-specific library files? "
  1067. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1068. $   GOSUB myread
  1069. $   IF ans.NES.""
  1070. $   THEN sitelib = ans
  1071. $   ELSE sitelib = dflt
  1072. $   ENDIF
  1073. $!
  1074. $!: determine where site specific architecture-dependent libraries go.
  1075. $   IF .NOT.silent 
  1076. $   THEN TYPE SYS$INPUT:
  1077.  
  1078. The installation process will also create a directory for
  1079. architecture-dependent site-specific extensions and modules.
  1080. $   ENDIF
  1081. $   dflt = sitelib - "]" + "." + archname + "]"
  1082. $   rp = "Pathname for the site-specific architecture-dependent library files? "
  1083. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1084. $   GOSUB myread
  1085. $   IF ans.NES.""
  1086. $   THEN sitearch = ans
  1087. $   ELSE sitearch = dflt
  1088. $   ENDIF
  1089. $!
  1090. $!: determine where old public architecture dependent libraries might be
  1091. $!
  1092. $!: determine where public executables go
  1093. $   dflt = prefix - ".]" + ".BIN]"
  1094. $   rp = "Pathname where the public executables will reside? "
  1095. $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
  1096. $   GOSUB myread
  1097. $   IF ans.NES.""
  1098. $   THEN bin = ans
  1099. $   ELSE bin = dflt
  1100. $   ENDIF
  1101. $!
  1102. $!: determine where manual pages are on this system
  1103. $!: What suffix to use on installed man pages
  1104. $!: see if we can have long filenames
  1105. $!: determine where library module manual pages go
  1106. $!: What suffix to use on installed man pages
  1107. $!: see what memory models we can support
  1108. $!
  1109. $ ENDIF !%Config-I-VMS, skip "where install" questions
  1110. $!
  1111. $!: see if we need a special compiler
  1112. $! cc_list = "cc/vaxc|cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
  1113. $!
  1114. $ nocc = "f"
  1115. $ vms_cc_dflt = ""
  1116. $ vms_cc_available = ""
  1117. $!
  1118. $ OPEN/WRITE CONFIG ccvms.c
  1119. $ WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
  1120. $ WRITE CONFIG "#include <stdio.h>"
  1121. $ WRITE CONFIG "int main() {"
  1122. $ WRITE CONFIG "#ifdef __DECC"
  1123. $ WRITE CONFIG "        printf(""/DECC\n"");"
  1124. $ WRITE CONFIG "#else"
  1125. $ WRITE CONFIG "        printf(""/VAXC\n"");"
  1126. $ WRITE CONFIG "#endif"
  1127. $ WRITE CONFIG "        exit(0);"
  1128. $ WRITE CONFIG "}"
  1129. $ CLOSE CONFIG
  1130. $!
  1131. $ DEFINE SYS$ERROR _NLA0:
  1132. $ DEFINE SYS$OUTPUT _NLA0:
  1133. $ cc/NoObj/list=ccvms.lis ccvms.c
  1134. $ tmp = $status
  1135. $ DEASSIGN SYS$OUTPUT
  1136. $ DEASSIGN SYS$ERROR
  1137. $ IF (silent) THEN GOSUB Shut_up
  1138. $! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
  1139. $!
  1140. $ IF tmp.NE.%X10B90001
  1141. $ THEN 
  1142. $  IF tmp.NE.%X10000001
  1143. $  THEN 
  1144. $    nocc = "t"  !%X10000001 is return from gcc
  1145. $    GOTO Gcc_initial_check
  1146. $  ENDIF
  1147. $ ENDIF
  1148. $!
  1149. $ GOSUB List_Parse
  1150. $ IF .NOT.silent THEN echo ""
  1151. $ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'" 
  1152. $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line) 
  1153. $ THEN 
  1154. $   vms_cc_dflt = "/vaxc"
  1155. $   vms_cc_available = vms_cc_available + "cc/vaxc "
  1156. $   IF .NOT.silent
  1157. $   THEN 
  1158. $     echo "%Config-I-VMS, Will try cc/decc..."
  1159. $   ENDIF
  1160. $   DEFINE SYS$ERROR _NLA0:
  1161. $   DEFINE SYS$OUTPUT _NLA0:
  1162. $   SET NOON
  1163. $   cc/decc/NoObj/list=ccvms.lis ccvms.c
  1164. $   tmp = $status
  1165. $   DEASSIGN SYS$OUTPUT
  1166. $   DEASSIGN SYS$ERROR
  1167. $   SET ON
  1168. $   IF (silent) THEN GOSUB Shut_up
  1169. $   IF tmp.NE.%X10B90001
  1170. $   THEN
  1171. $     echo "%Config-I-VMS, Apparently you don't have that one."
  1172. $   ELSE
  1173. $     GOSUB List_parse
  1174. $     echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
  1175. $     vms_cc_available = vms_cc_available + "cc/decc "
  1176. $   ENDIF
  1177. $ ELSE
  1178. $   IF F$LOCATE("DEC",line).NE.F$LENGTH(line) 
  1179. $   THEN 
  1180. $     vms_cc_dflt = "/decc"
  1181. $     vms_cc_available = vms_cc_available + "cc/decc "
  1182. $     echo "%Config-I-VMS, Will try cc/vaxc..."
  1183. $     DEFINE SYS$ERROR _NLA0:
  1184. $     DEFINE SYS$OUTPUT _NLA0:
  1185. $     SET NOON
  1186. $     cc/vaxc/NoObj/list=ccvms.lis ccvms.c
  1187. $     tmp = $status
  1188. $     DEASSIGN SYS$OUTPUT
  1189. $     DEASSIGN SYS$ERROR
  1190. $     SET ON
  1191. $     IF (silent) THEN GOSUB Shut_up
  1192. $     IF tmp.NE.%X10B90001
  1193. $     THEN
  1194. $       echo "%Config-I-VMS, Apparently you don't have that one."
  1195. $     ELSE
  1196. $       GOSUB List_parse
  1197. $       echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
  1198. $       vms_cc_available = vms_cc_available + "cc/vaxc "
  1199. $     ENDIF
  1200. $   ENDIF
  1201. $ ENDIF
  1202. $!
  1203. $Gcc_initial_check:
  1204. $ echo "%Config-I-VMS, Checking for Gcc"
  1205. $ OPEN/WRITE CONFIG gccvers.lis
  1206. $ DEFINE SYS$ERROR CONFIG
  1207. $ DEFINE SYS$OUTPUT CONFIG
  1208. $ 'gcc_symbol'/noobj/version _nla0:
  1209. $ tmp = $status
  1210. $ DEASSIGN SYS$OUTPUT
  1211. $ DEASSIGN SYS$ERROR
  1212. $ IF (silent) THEN GOSUB Shut_up
  1213. $ CLOSE CONFIG
  1214. $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
  1215. $ THEN
  1216. $   echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
  1217. $   goto cc_cleanup
  1218. $ ENDIF
  1219. $ OPEN/READ CONFIG gccvers.lis
  1220. $GCC_List_Read:
  1221. $ READ/END_OF_FILE=GCC_List_End CONFIG line
  1222. $ GOTO GCC_List_Read
  1223. $GCC_List_End:
  1224. $ CLOSE CONFIG
  1225. $ echo line
  1226. $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
  1227. $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
  1228. $!
  1229. $CC_Cleanup:
  1230. $ DELETE/NOLOG/NOCONFIRM ccvms.*;
  1231. $CC_Desired:
  1232. $!: see if we need a special compiler
  1233. $! echo ""
  1234. $ echo "%Config-I-VMS, available compiler(s):"
  1235. $ echo "( ''vms_cc_available')"
  1236. $ IF .NOT.nocc 
  1237. $ THEN
  1238. $   dflt = "cc''vms_cc_dflt'"  !-> "cc" in case first compile went OK
  1239. $ ELSE
  1240. $   dflt = gcc_symbol
  1241. $ ENDIF
  1242. $ rp = "Use which C compiler? [''dflt'] "
  1243. $ GOSUB myread
  1244. $ IF ans.NES.""
  1245. $ THEN
  1246. $   ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
  1247. $   Mcc = ans
  1248. $   IF F$LOCATE("dec",ans).NE.F$LENGTH(ans)
  1249. $   THEN
  1250. $     Mcc = "cc/decc"
  1251. $     Using_Dec_C = "Yes"
  1252. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1253. $   ENDIF
  1254. $   IF F$LOCATE("vax",ans).NE.F$LENGTH(ans)
  1255. $   THEN
  1256. $     Mcc = "cc/vaxc"
  1257. $     Using_Vax_C = "Yes"
  1258. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1259. $   ENDIF
  1260. $   IF Mcc.NES.dflt
  1261. $   THEN
  1262. $     IF F$LOCATE("dec",dflt).NE.F$LENGTH(dflt) 
  1263. $     THEN 
  1264. $       C_COMPILER_Replace = "CC=cc=''Mcc'"
  1265. $     ELSE
  1266. $       Using_Dec_C = "Yes"
  1267. $       IF F$LOCATE("vax",dflt).NE.F$LENGTH(dflt) 
  1268. $       THEN
  1269. $         C_COMPILER_Replace = "CC=cc=''Mcc'"
  1270. $       ENDIF
  1271. $     ENDIF
  1272. $   ELSE
  1273. $     IF Mcc .EQS. "cc/decc"
  1274. $     THEN
  1275. $       Using_Dec_C = "Yes"
  1276. $       C_COMPILER_Replace = "CC=cc=''Mcc'"
  1277. $     ENDIF
  1278. $   ENDIF
  1279. $ ELSE 
  1280. $   Mcc = dflt
  1281. $   IF Mcc .EQS. "cc/decc"
  1282. $   THEN
  1283. $     Using_Dec_C = "Yes"
  1284. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1285. $   ENDIF
  1286. $   IF Mcc .EQS. "cc/vaxc"
  1287. $   THEN
  1288. $     Using_Vax_C = "Yes"
  1289. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1290. $   ENDIF
  1291. $   IF Mcc .EQS. "gcc"
  1292. $   THEN
  1293. $     Using_Gnu_C = "Yes"
  1294. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1295. $   ENDIF
  1296. $ ENDIF
  1297. $Decc_Version_check:
  1298. $ IF "''Using_Dec_C'".EQS."Yes"
  1299. $ THEN
  1300. $   echo ""
  1301. $   echo4 "Checking for Dec C's version number..." !>&4
  1302. $   OPEN/WRITE CONFIG deccvers.c
  1303. $   WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
  1304. $   WRITE CONFIG "#include <stdio.h>"
  1305. $   WRITE CONFIG "int main() {"
  1306. $   WRITE CONFIG "#ifdef __DECC"
  1307. $   WRITE CONFIG "#ifdef __DECC_VER"
  1308. $   WRITE CONFIG "        printf(""%i\n"", __DECC_VER);"
  1309. $   WRITE CONFIG "#else"
  1310. $   WRITE CONFIG "        printf(""%i\n"", ""1"");"
  1311. $   WRITE CONFIG "#endif"
  1312. $   WRITE CONFIG "#endif"
  1313. $   WRITE CONFIG "        exit(0);"
  1314. $   WRITE CONFIG "}"
  1315. $   CLOSE CONFIG
  1316. $   DEFINE SYS$ERROR _NLA0:
  1317. $   DEFINE SYS$OUTPUT _NLA0:
  1318. $   'Mcc' deccvers.c
  1319. $   tmp = $status
  1320. $   DEASSIGN SYS$ERROR _NLA0:
  1321. $   DEASSIGN SYS$OUTPUT _NLA0:
  1322. $   IF (silent) THEN GOSUB Shut_up
  1323. $   DEFINE SYS$ERROR _NLA0:
  1324. $   DEFINE SYS$OUTPUT _NLA0:
  1325. $   link deccvers.obj
  1326. $   tmp = $status
  1327. $   DEASSIGN SYS$ERROR
  1328. $   DEASSIGN SYS$OUTPUT
  1329. $   IF (silent) THEN GOSUB Shut_up
  1330. $   OPEN/WRITE CONFIG deccvers.out
  1331. $   DEFINE SYS$ERROR CONFIG
  1332. $   DEFINE SYS$OUTPUT CONFIG
  1333. $   mcr []deccvers.exe
  1334. $   tmp = $status
  1335. $   CLOSE CONFIG
  1336. $   DEASSIGN SYS$OUTPUT
  1337. $   DEASSIGN SYS$ERROR
  1338. $   IF (silent) THEN GOSUB Shut_up
  1339. $   OPEN/READ CONFIG deccvers.out
  1340. $   READ/END_OF_FILE=Dec_c_cleanup CONFIG line
  1341. $Dec_c_cleanup:
  1342. $   CLOSE CONFIG
  1343. $!   DELETE/NOLOG/NOCONFIRM deccvers.*;
  1344. $   echo "You are using Dec C ''line'"
  1345. $   Dec_C_Version = line
  1346. $ ENDIF
  1347. $Vaxc_Invoke_check:
  1348. $ IF "''Using_Vax_C'".EQS."Yes"
  1349. $ THEN
  1350. $   echo ""
  1351. $   echo4 "Checking to see how to invoke Vax C..."
  1352. $   OPEN/WRITE CONFIG vaxcchk.c
  1353. $   WRITE CONFIG "#include <stdio.h>"
  1354. $   WRITE CONFIG "int main() {"
  1355. $   WRITE CONFIG "        printf(""%i\n"", ""1"");"
  1356. $   WRITE CONFIG "        exit(0);"
  1357. $   WRITE CONFIG "}"
  1358. $   CLOSE CONFIG
  1359. $   DEFINE SYS$ERROR _NLA0:
  1360. $   DEFINE SYS$OUTPUT _NLA0:
  1361. $   SET NOON
  1362. $   cc/vaxc/NoObj vaxcchk.c
  1363. $   tmp = $status
  1364. $   DEASSIGN SYS$OUTPUT
  1365. $   DEASSIGN SYS$ERROR
  1366. $   SET ON
  1367. $   IF (silent) THEN GOSUB Shut_up
  1368. $   IF tmp.NE.%X10B90001
  1369. $   THEN
  1370. $     Mcc = "cc"
  1371. $   ELSE
  1372. $     Mcc = "cc/vaxc"
  1373. $   ENDIF
  1374. $Vax_c_cleanup:
  1375. $   DELETE/NOLOG/NOCONFIRM vaxcchk.*;
  1376. $ ENDIF
  1377. $Gcc_check:
  1378. $ if "''using_gnu_c'" .eqs. "Yes"
  1379. $ THEN
  1380. $ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
  1381. $ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
  1382. $ gcclib_olb  = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
  1383. $ IF gcclib_olb .EQS. "" 
  1384. $ THEN 
  1385. $! These objects/libs come w/ gcc 2.7.2 for AXP:
  1386. $   tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
  1387. $   IF tmp .NES. "" then gcclib_olb = tmp
  1388. $   tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
  1389. $   IF tmp .NES. "" 
  1390. $   THEN 
  1391. $     IF gcclib_olb .EQS. "" 
  1392. $     THEN gcclib_olb = tmp
  1393. $     ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
  1394. $     ENDIF
  1395. $   ENDIF
  1396. $   tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
  1397. $   IF tmp .NES. "" 
  1398. $   THEN 
  1399. $     IF gcclib_olb .EQS. "" 
  1400. $     THEN gcclib_olb = tmp
  1401. $     ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
  1402. $     ENDIF
  1403. $   ENDIF
  1404. $   tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
  1405. $   IF tmp .NES. "" 
  1406. $   THEN 
  1407. $     IF gcclib_olb .EQS. "" 
  1408. $     THEN gcclib_olb = tmp
  1409. $     ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
  1410. $     ENDIF
  1411. $   ENDIF
  1412. $   IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
  1413. $ ELSE
  1414. $   gcclib_olb = gcclib_olb + "/lib"
  1415. $ ENDIF
  1416. $ IF   gcclib_olb .NES. "" .AND. -
  1417.      (vaxcrtl_olb .NES. "" .OR. -
  1418.       vaxcrtl_exe .NES. "" )
  1419. $ THEN
  1420. $   echo ""
  1421. $   echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
  1422. $   OPEN/WRITE CONFIG gccvers.c
  1423. $   WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
  1424. $   WRITE CONFIG "#include <stdio.h>"
  1425. $   WRITE CONFIG "int main() {"
  1426. $   WRITE CONFIG "#ifdef __GNUC__"
  1427. $   WRITE CONFIG "#ifdef __VERSION__"
  1428. $   WRITE CONFIG "        printf(""%s\n"", __VERSION__);"
  1429. $   WRITE CONFIG "#else"
  1430. $   WRITE CONFIG "        printf(""%s\n"", ""1"");"
  1431. $   WRITE CONFIG "#endif"
  1432. $   WRITE CONFIG "#endif"
  1433. $   WRITE CONFIG "        exit(0);"
  1434. $   WRITE CONFIG "}"
  1435. $   CLOSE CONFIG
  1436. $   DEFINE SYS$ERROR _NLA0:
  1437. $   DEFINE SYS$OUTPUT _NLA0:
  1438. $   'Mcc' gccvers.c
  1439. $   tmp = $status
  1440. $   DEASSIGN SYS$ERROR _NLA0:
  1441. $   DEASSIGN SYS$OUTPUT _NLA0:
  1442. $   IF (silent) THEN GOSUB Shut_up
  1443. $   DEFINE SYS$ERROR _NLA0:
  1444. $   DEFINE SYS$OUTPUT _NLA0:
  1445. $   IF vaxcrtl_exe .EQS. ""
  1446. $   THEN 
  1447. $     IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
  1448. $     THEN 
  1449. $       link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
  1450. $       tmp = $status
  1451. $     ELSE
  1452. $       link gccvers.obj,'gcclib_olb'
  1453. $       tmp = $status
  1454. $     ENDIF
  1455. $   ELSE
  1456. $     OPEN/WRITE CONFIG GCCVERS.OPT
  1457. $     WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
  1458. $     CLOSE CONFIG
  1459. $     link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
  1460. $     tmp = $status
  1461. $   ENDIF
  1462. $   DEASSIGN SYS$ERROR
  1463. $   DEASSIGN SYS$OUTPUT
  1464. $   IF (silent) THEN GOSUB Shut_up
  1465. $   OPEN/WRITE CONFIG gccvers.out
  1466. $   DEFINE SYS$ERROR CONFIG
  1467. $   DEFINE SYS$OUTPUT CONFIG
  1468. $   mcr []gccvers.exe
  1469. $   tmp = $status
  1470. $   CLOSE CONFIG
  1471. $   DEASSIGN SYS$OUTPUT
  1472. $   DEASSIGN SYS$ERROR
  1473. $   IF (silent) THEN GOSUB Shut_up
  1474. $   OPEN/READ CONFIG gccvers.out
  1475. $   READ/END_OF_FILE=Gcc_cleanup CONFIG line
  1476. $Gcc_cleanup:
  1477. $   CLOSE CONFIG
  1478. $   DELETE/NOLOG/NOCONFIRM gccvers.*;
  1479. $   IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
  1480. $   THEN 
  1481. $     echo "You are not using GNU cc."
  1482. $     GOTO Host_name
  1483. $   ELSE 
  1484. $     echo "You are using GNU cc ''line'"
  1485. $     Using_Gnu_C = "Yes"
  1486. $     C_COMPILER_Replace = "CC=cc=''Mcc'"
  1487. $     GOTO Include_dirs
  1488. $   ENDIF
  1489. $ ENDIF
  1490. $endif
  1491. $ GOTO Host_name
  1492. $!
  1493. $List_Parse:
  1494. $ OPEN/READ CONFIG ccvms.lis
  1495. $ READ CONFIG line
  1496. $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
  1497. $ THEN
  1498. $   read CONFIG line
  1499. $   archsufx = "VAX"
  1500. $ ELSE
  1501. $   archsufx = "AXP"
  1502. $ ENDIF
  1503. $ CLOSE CONFIG
  1504. $ line = F$EDIT(line,"TRIM,COMPRESS")
  1505. $ line = line - "Page 1"           ! occurs at end all compilers
  1506. $ line = line - "CCVMS "           ! filename appears w/ VAXC
  1507. $ line = line - "Source Listing "  ! Seen w/ AXP DECC
  1508. $ tmp = F$EXTRACT(0,20,line)       !timestamp, e.g. "30-JUL-1996 21:12:54 "
  1509. $ line = line - tmp
  1510. $ line = F$EDIT(line,"TRIM")       !bit redundant but we're in no big hurry
  1511. $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
  1512. $ RETURN
  1513. $!
  1514. $Include_dirs:
  1515. $!: What should the include directory be ?
  1516. $ dflt = gcclib_olb 
  1517. $ rp = "Where are the include files you want to use? "
  1518. $ IF f$length( rp + "[''dflt'] " ).gt.76
  1519. $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
  1520. $ ELSE rp = rp + "[''dflt'] "
  1521. $ ENDIF
  1522. $ GOSUB myread
  1523. $ usrinc = ans
  1524. $!
  1525. $!: see if we have to deal with yellow pages, now NIS.
  1526. $!: now get the host name
  1527. $Host_name:
  1528. $ echo ""
  1529. $ echo4 "Figuring out host name..." !>&4
  1530. $ myhostname = ""
  1531. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
  1532. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
  1533. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
  1534. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
  1535. $  IF myhostname.eqs."".and. -
  1536.       F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
  1537.       F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN - 
  1538.      myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN") 
  1539. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
  1540. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
  1541. $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
  1542. $  IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
  1543. $!: you do not want to know about this
  1544. $!: verify guess
  1545. $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
  1546. $ GOSUB myread
  1547. $ IF (.not.ans).and.(ans.NES."")
  1548. $   THEN 
  1549. $     READ SYS$COMMAND/PROMPT= - 
  1550.  "Please type the (one word) name of your host: " ans
  1551. $     myhostname = ans
  1552. $ ENDIF
  1553. $!: translate upper to lower if necessary
  1554. $ myhostname = F$EDIT(myhostname,"COLLAPSE")
  1555. $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
  1556. $ IF mylowhostname.NES.myhostname
  1557. $ THEN
  1558. $   echo "(Normalizing case in your host name)"
  1559. $   myhostname = mylowhostname
  1560. $ ENDIF
  1561. $!
  1562. $ fp = F$LOCATE(".",myhostname)
  1563. $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
  1564. $ IF mydomain.NES.""  !no periods in DECnet names like "MYDECNODE::"
  1565. $ THEN
  1566. $   rp = "What is your domain name? [''mydomain'] "
  1567. $   GOSUB myread
  1568. $   IF ans THEN mydomain = ans
  1569. $!: translate upper to lower if necessary
  1570. $   mydomain = F$EDIT(mydomain,"COLLAPSE")
  1571. $   mylowdomain = F$EDIT(mydomain," LOWERCASE")
  1572. $   IF mylowdomain.NES.mydomain
  1573. $   THEN
  1574. $     echo "(Normalizing case in your domain name)"
  1575. $     mydomain = mylowdomain
  1576. $   ENDIF
  1577. $ ENDIF
  1578. $ myhostname = myhostname - mydomain
  1579. $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
  1580. $ IF .NOT.silent 
  1581. $ THEN TYPE SYS$INPUT:
  1582.  
  1583. I need to get your e-mail address in Internet format if possible, i.e.
  1584. something like user@host.domain. Please answer accurately since I have
  1585. no easy means to double check it. The default value provided below
  1586. is most probably close to the reality but may not be valid from outside
  1587. your organization...
  1588. $ ENDIF
  1589. $ dflt = "''cf_by@''myhostname'"+"''mydomain'"
  1590. $ rp = "What is your e-mail address? [''dflt'] "
  1591. $ GOSUB myread
  1592. $ IF ans
  1593. $ THEN cf_email = ans
  1594. $ ELSE cf_email = dflt
  1595. $ ENDIF
  1596. $!
  1597. $ IF .NOT.silent 
  1598. $ THEN TYPE SYS$INPUT:
  1599.  
  1600. If you or somebody else will be maintaining perl at your site, please
  1601. fill in the correct e-mail address here so that they may be contacted
  1602. if necessary. Currently, the "perlbug" program included with perl
  1603. will send mail to this address in addition to perlbug@perl.com. You may
  1604. enter "none" for no administrator.
  1605. $ ENDIF
  1606. $ dflt = "''cf_email'"
  1607. $ rp = "Perl administrator e-mail address [''dflt'] "
  1608. $ GOSUB myread
  1609. $ IF ans
  1610. $ THEN perladmin = ans
  1611. $ ELSE perladmin = dflt
  1612. $ ENDIF
  1613. $!
  1614. $!: determine where public executable scripts go
  1615. $!: determine perl absolute location
  1616. $!: figure out how to guarantee perl startup
  1617. $!
  1618. $!: see how we invoke the C preprocessor
  1619. $! echo ""
  1620. $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
  1621. $!: Set private lib path
  1622. $!: Now check and see which directories actually exist, avoiding duplicates
  1623. $!: determine optimize, if desired, or use for debug flag also
  1624. $!: We will not override a previous value, but we might want to
  1625. $!: augment a hint file
  1626. $!: the following weeds options from ccflags that are of no interest to cpp
  1627. $!: flags used in final linking phase
  1628. $!: Try to guess additional flags to pick up local libraries.
  1629. $!: coherency check
  1630. $! echo ""
  1631. $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
  1632. $!: compute shared library extension
  1633. $!: Looking for optional libraries
  1634. $!: see if nm is to be used to determine whether a symbol is defined or not
  1635. $!: get list of predefined functions in a handy place
  1636. $!: see if we have sigaction
  1637. $!: see whether socketshr exists
  1638. $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
  1639. $ THEN
  1640. $   has_socketshr     = "T"
  1641. $   echo ""
  1642. $   echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
  1643. $ endif
  1644. $ if (Dec_C_Version .ge. 50200000)
  1645. $ THEN
  1646. $   Has_Dec_C_Sockets = "T"
  1647. $   echo ""
  1648. $   echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
  1649. $ ENDIF
  1650. $ ! Hey, we've got both. Default to Dec C, then, since it's better
  1651. $ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
  1652. $ THEN
  1653. $   echo ""
  1654. $   echo "You've got sockets available. Which socket stack do you want to"
  1655. $   echo "build into perl?"
  1656. $   if "''has_dec_c_sockets'".eqs."T"
  1657. $   THEN
  1658. $     dflt = "DECC"
  1659. $   else
  1660. $     dlft = "SOCKETSHR"
  1661. $   endif
  1662. $   rp = "Choose socket stack (NONE"
  1663. $   if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
  1664. $   if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
  1665. $   rp = rp + ") [''dflt'] "
  1666. $   GOSUB myread
  1667. $   IF "''ans'".eqs."" THEN ans = "''dflt'"
  1668. $   has_dec_c_sockets = "F"
  1669. $   has_socketshr = "F"
  1670. $   ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
  1671. $   IF ans.eqs."decc" then has_dec_c_sockets = "T"
  1672. $   IF ans.eqs."socketshr" then has_socketshr = "T"
  1673. $ endif
  1674. $!
  1675. $!
  1676. $! Ask about threads, if appropriate
  1677. $ if (Using_Dec_C.eqs."Yes")
  1678. $ THEN
  1679. $   echo "This version of Perl can be built with threads. While really nifty,
  1680. $   echo "they are a beta feature, and there is a speed penalty for perl
  1681. $   echo "programs if you build with threads *even if you don't use them*
  1682. $   echo ""
  1683. $   dflt = "n"
  1684. $   rp = "Build with threads? [''dflt'] "
  1685. $   GOSUB myread
  1686. $   if ans.eqs."" then ans = dflt
  1687. $   if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
  1688. $   THEN
  1689. $     use_threads="T"
  1690. $     ! Are they on VMS 7.1 on an alpha?
  1691. $     if (Archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
  1692. $     THEN
  1693. $       echo ""
  1694. $       echo "Threaded perl can be linked to use multiple kernel threads
  1695. $       echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
  1696. $       echo "allows multiple threads to execute simultaneously on an SMP
  1697. $       echo "system as well as preventing a single thread from blocking
  1698. $       echo "all the threads in a program, even on a single-processor
  1699. $       echo "machine. Unfortunately this feature isn't safe on an
  1700. $       echo "unpatched 7.1 system. (Several OS patches were required when
  1701. $       echo "this procedure was written)
  1702. $       echo ""
  1703. $       dflt = "N"
  1704. $       rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
  1705. $       gosub myread
  1706. $       if ans.eqs."" then ans="''dflt'"
  1707. $       if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
  1708. $       THEN
  1709. $         Thread_Live_Dangerously = "MT=MT=1"
  1710. $       ENDIF
  1711. $     ENDIF
  1712. $   ENDIF
  1713. $ ENDIF
  1714. $!
  1715. $! Pre-load %ENV?
  1716. $ echo ""
  1717. $ echo "Because of the way perl fetches the list of logical names
  1718. $ echo "for the %ENV hash (we spawn a subprocess that does a
  1719. $ echo "SHOW LOGICALS *, which is expensive), we defer fetching it
  1720. $ echo "until the first time a program iterates over the %ENV hash.
  1721. $ echo "This means things like 'exists($ENV{'SYS$MANAGER'})' will
  1722. $ echo "return false unless you've already accessed $ENV{SYS$MANAGER}
  1723. $ echo "or done something like a keys %ENV."
  1724. $ echo ""
  1725. $ echo "If you choose, perl can populate the %ENV hash at startup.
  1726. $ echo "This will exact both a memory penalty (to store the keys) and
  1727. $ echo "a time penalty (to spawn the subprocess) every time you invoke
  1728. $ echo "perl. Depending on your system, this might not be a big deal.
  1729. $ echo ""
  1730. $ dflt = "N"
  1731. $ rp = "Populate %ENV at startup time? [''dflt'] "
  1732. $ GOSUB myread
  1733. $ if ans.eqs."" then ans="''dflt'"
  1734. $ preload_env = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
  1735. $!
  1736. $! Ask if they want to use perl's memory allocator
  1737. $ echo ""
  1738. $ echo "Perl has a built-in memory allocator that's tuned for perl's
  1739. $ echo "normal memory usage. It's oftentimes better than the standard
  1740. $ echo "system memory allocator. It also has the advantage of providing
  1741. $ echo "memory allocation statistics, if you choose to enable them.
  1742. $ echo ""
  1743. $ dflt = "N"
  1744. $ rp = "Build with perl's memory allocator? [''dflt'] "
  1745. $ GOSUB myread
  1746. $ if ans.eqs."" then ans="''dflt'"
  1747. $ mymalloc = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
  1748. $ if mymalloc.eqs."Y"
  1749. $ THEN
  1750. $   if use_debugging_perl.eqs."Y"
  1751. $   THEN
  1752. $     echo ""
  1753. $     echo "Perl can keep statistics on memory usage if you choose to use
  1754. $     echo "them. This is useful for debugging, but does have some
  1755. $     echo "performance overhead.
  1756. $     echo ""
  1757. $     dflt = "N"
  1758. $     rp = "Do you want the debugging memory allocator? [''dflt'] "
  1759. $     gosub myread
  1760. $     if ans.eqs."" then ans="''dflt'"
  1761. $     use_debugmalloc = f$extract(0, 1, f$edit(ans, "TRIM,COMPRESS,UPCASE"))
  1762. $   ENDIF
  1763. $   ! Check which memory allocator we want
  1764. $   echo ""
  1765. $   echo "There are currently three different memory allocators: the
  1766. $   echo "default (which is a pretty good general-purpose memory manager),
  1767. $   echo "the TWO_POT allocator (which is optimized to save memory for
  1768. $   echo "larger allocations), and PACK_MALLOC (which is optimized to save
  1769. $   echo "memory for smaller allocations). They're all good, but if your
  1770. $   echo "usage tends towards larger chunks use TWO_POT, otherwise use
  1771. $   echo "PACK_MALLOC."
  1772. $   echo ""
  1773. $   dflt = "DEFAULT"
  1774. $   rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
  1775. $   GOSUB myread
  1776. $   if ans.eqs."" then ans = "''dflt'"
  1777. $   if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
  1778. $   if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
  1779. $ ENDIF
  1780. $!
  1781. $! Ask for their default list of extensions to build
  1782. $ echo ""
  1783. $ echo "It's time to specify which modules you want to build into
  1784. $ echo "perl. Most of these are standard and should be chosen, though
  1785. $ echo "you might, for example, want to build GDBM_File instead of
  1786. $ echo "SDBM_File if you have the GDBM library built on your machine
  1787. $ echo "
  1788. $ echo "Which modules do you want to build into perl?"
  1789. $ dflt = "Fcntl Errno IO Opcode Dumper attrs re Stdio DCLsym B SDBM_File"
  1790. $ if Using_Dec_C.eqs."Yes"
  1791. $ THEN
  1792. $   dflt = dflt + " POSIX"
  1793. $   if Use_Threads.eqs."T"
  1794. $   THEN
  1795. $     dflt = dflt + " Thread"
  1796. $   ENDIF
  1797. $ ENDIF
  1798. $ rp = "[''dflt'] "
  1799. $ GOSUB myread
  1800. $ if ans.eqs."" then ans = "''dflt'"
  1801. $ extensions = "''ans'"
  1802. $!
  1803. $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
  1804. $ echo ""
  1805. $ echo "%Config-I-VMS, Checking your ""make"" utilities..."
  1806. $! If the 'build' that you use is not here add it and it's test
  1807. $! switch to the _END_ of these strings (and increment max_build)
  1808. $! (e.g. builders = builders + "/FOOMAKE" 
  1809. $!       probers  = probers + " -fooVersionSwitch"
  1810. $! ) & please let me know about it.
  1811. $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
  1812. $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
  1813. $ max_build = 7
  1814. $!
  1815. $ orig_dflt = "MMK"
  1816. $ default_set = ""
  1817. $ ok_builders = ""
  1818. $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
  1819. $ WRITE CONFIG "dont_make_anything_yet:"
  1820. $ WRITE CONFIG F$FAO("!_")
  1821. $ CLOSE CONFIG
  1822. $ n = 0
  1823. $ messages = F$ENVIRONMENT("MESSAGE")
  1824. $Build_probe:
  1825. $ build = F$ELEMENT(n,"/",builders)
  1826. $ probe  = F$ELEMENT(n,"!",probers)
  1827. $ echo "Testing whether you have ''build' on your system..."
  1828. $ SET NOON                                        !sorry :-(
  1829. $ ON CONTROL_Y THEN GOTO Reenable_messages_build  !sorry :-(
  1830. $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT          !sorry :-(
  1831. $ 'build' 'probe'
  1832. $ IF ($SEVERITY .EQ. 1)
  1833. $ THEN 
  1834. $   echo "OK."
  1835. $   IF (build .EQS. orig_dflt) 
  1836. $   THEN 
  1837. $     default_set = "TRUE"
  1838. $     dflt = build
  1839. $   ENDIF
  1840. $   ok_builders = ok_builders + " " + build
  1841. $   IF (.NOT. default_set) THEN dflt = build
  1842. $ ELSE 
  1843. $   echo "Nope."
  1844. $ ENDIF
  1845. $Reenable_messages_build:                         !hope you made it here :-)
  1846. $ SET MESSAGE 'messages'                          !hope you made it here :-)
  1847. $ SET ON                                          !hope you made it here :-)
  1848. $ n = n + 1
  1849. $ IF (n .LT. max_build) THEN GOTO Build_probe
  1850. $!
  1851. $ echo ""
  1852. $ IF (ok_builders .NES. "") 
  1853. $ THEN
  1854. $   echo "Here is the list of builders you can apparently use:"
  1855. $   echo "(",ok_builders," )"
  1856. $   rp = "Which """"make"""" utility do you wish to use [''dflt']? "
  1857. $   GOSUB myread
  1858. $   ans = F$EDIT(ans,"TRIM, COMPRESS")
  1859. $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
  1860. $   IF (ans .EQS. "") 
  1861. $   THEN build = dflt
  1862. $   ELSE build = ans
  1863. $   ENDIF
  1864. $ ELSE
  1865. $   TYPE SYS$INPUT:
  1866.  
  1867. %Config-E-VMS, ERROR:
  1868.  Well this looks pretty serious. Perl5 cannot be compiled without a "make"
  1869.  utility of some sort and after checking my "builders" list I cannot find
  1870.  the symbol or command you use on your system to compile programs.
  1871.  
  1872. $   READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
  1873. $   ans = F$EDIT(ans,"TRIM, COMPRESS")
  1874. $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
  1875. $   IF (ans .EQS. "") 
  1876. $   THEN build = dflt
  1877. $     echo "I don't know where 'make' is, and my life depends on it."
  1878. $     echo "Go find a make program or fix your DCL$PATH setting!"
  1879. $     echo "ABORTING..."
  1880. $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
  1881. $     STOP
  1882. $     EXIT 2 !$STATUS = "%X00000002" (error)
  1883. $   ELSE 
  1884. $     build = ans
  1885. $   ENDIF
  1886. $ ENDIF
  1887. $!
  1888. $ DELETE/NOLOG Makefile.;
  1889. $ GOTO Beyond_open
  1890. $Open_error:
  1891. $ TYPE SYS$INPUT:
  1892.  
  1893.  There seems to be trouble. I just tried to create a file in
  1894. $ echo4 'F$ENVIRONMENT("DEFAULT")'
  1895. $ TYPE SYS$INPUT:
  1896.  but was unsuccessful. I am stopping now. Please check that directories'
  1897.  PROTECTION bits. I will leave you in the directory where you started
  1898.  Configure.com
  1899. $ echo4 "ABORTING..."
  1900. $ GOTO Clean_up
  1901. $ STOP
  1902. $ EXIT
  1903. $!
  1904. $Beyond_open:
  1905. $! echo " Very well I will proceed with ""''build'"""
  1906. $ make = F$EDIT(build,"UPCASE")
  1907. $!
  1908. $!: locate the preferred pager for this system
  1909. $!pagers = "most|more|less|type/page"
  1910. $!rp='What pager is used on your system?'
  1911. $!
  1912. $! update [.vms]config.vms here
  1913. $!
  1914. $! update makefile here
  1915. $! echo4 "Updating makefile..."
  1916. $!
  1917. $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
  1918. $ THEN 
  1919. $   makefile    = ""          !wrt MANIFEST dir
  1920. $   UUmakefile  = "DESCRIP.MMS"  !wrt CWD dir
  1921. $   DEFmakefile = "DESCRIP.MMS"  !wrt DEF dir (?)
  1922. $ ELSE
  1923. $   makefile    = " -f [.VMS]Makefile." !wrt MANIFEST dir
  1924. $   UUmakefile  = "[-.VMS]Makefile."    !wrt CWD dir
  1925. $   DEFmakefile = "[-.VMS]Makefile."    !wrt DEF dir (?)
  1926. $ ENDIF
  1927. $!
  1928. $ IF macros.NES."" 
  1929. $ THEN 
  1930. $   tmp = F$LENGTH(macros)
  1931. $   macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
  1932. $   macros = "/macro=(" + macros  + ")"
  1933. $ ENDIF
  1934. $!
  1935. $! Invoke the subconfig piece
  1936. $!
  1937. $ echo ""
  1938. $ echo4 "Generating config.h"
  1939. $ dflt = F$ENVIRONMENT("DEFAULT")
  1940. $ SET DEFAULT [-.vms]
  1941. $ @subconfigure
  1942. $ SET DEFAULT 'dflt
  1943. $!
  1944. $! %Config-I-VMS, write perl_setup.com here
  1945. $!
  1946. $ echo ""
  1947. $ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
  1948. $ file_2_find = "[-.vms]perl_setup.com"
  1949. $ OPEN/WRITE CONFIG 'file_2_find'
  1950. $ WRITE CONFIG "$!"
  1951. $ WRITE CONFIG "$! Perl_Setup.com    ''cf_time'"
  1952. $ IF cf_email.NES.perladmin
  1953. $ THEN
  1954. $ WRITE CONFIG "$! perl configured by ''cf_email'"
  1955. $ ELSE
  1956. $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
  1957. $ ENDIF
  1958. $ WRITE CONFIG "$!"
  1959. $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
  1960.     prefix = prefix - "]" + ".]" 
  1961. $ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
  1962. $ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl"
  1963. $ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr.Exe"
  1964. $ IF (tzneedset)
  1965. $ THEN
  1966. $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
  1967. $ ELSE    !leave in but commented out (in case setting was from perl :-)
  1968. $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
  1969. $ ENDIF
  1970. $ WRITE CONFIG "$!"
  1971. $ WRITE CONFIG "$! Symbols for commonly used scripts:"
  1972. $ WRITE CONFIG "$!"
  1973. $ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
  1974. $ CLOSE CONFIG
  1975. $!
  1976. $ echo  ""
  1977. $ echo  "%Config-I-VMS, The file can be found at:"
  1978. $ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
  1979. $ echo  "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
  1980. $ echo  "-Config-I-VMS, when you are satisfied with a successful compilation,"
  1981. $ echo  "-Config-I-VMS, testing, and installation of your perl."
  1982. $ echo  ""
  1983. $!
  1984. $!figure out where we "are" by parsing 'vms_default_directory_name' 
  1985. $!
  1986. $ set_def_command = ""
  1987. $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]" 
  1988. $ tmp = vms_default_directory_name - dflt - "]"
  1989. $ i = 0
  1990. $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
  1991. $Set_def_loop:
  1992. $ tmp1 = F$ELEMENT(i,".",tmp)
  1993. $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
  1994. $ IF i .EQ. 0 
  1995. $ THEN set_def_command = "set default [-"
  1996. $ ELSE set_def_command = set_def_command + "-"
  1997. $ ENDIF
  1998. $ i = i + 1
  1999. $ GOTO Set_def_loop
  2000. $Beyond_set_def_loop:
  2001. $ IF set_def_command.NES.""
  2002. $ THEN
  2003. $   set_def_command = set_def_command - "-" + "]"
  2004. $   echo4 ""
  2005. $   echo4 "In order to build ''package' you must now issue the commands:"
  2006. $   echo4 ""
  2007. $   echo4 " ''set_def_command'"
  2008. $ ELSE
  2009. $   echo4 ""
  2010. $   echo4 "In order to build ''package' you must now issue the command:"
  2011. $   echo4 ""
  2012. $ ENDIF
  2013. $ echo4 " ''make'''makefile'", macros
  2014. $ echo4 ""
  2015. $!
  2016. $Clean_up:
  2017. $ IF (silent)
  2018. $ THEN
  2019. $   DEASSIGN SYS$OUTPUT
  2020. $!   DEASSIGN SYS$ERROR
  2021. $ ENDIF
  2022. $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
  2023. $ IF F$GETJPI("","FILCNT").NE.vms_filcnt 
  2024. $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
  2025. $ ENDIF
  2026. $ dflt = F$ENVIRONMENT("DEFAULT")
  2027. $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
  2028. $ THEN
  2029. $   IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
  2030. $   SET DEFAULT [-]
  2031. $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
  2032. $   DELETE/NOLOG/NOCONFIRM UU.DIR;
  2033. $ ENDIF
  2034. $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
  2035. $ STOP
  2036. $ EXIT
  2037. $!: End of Configure
  2038.